package test4_11.demo02;

import java.io.*;

public class Homework21_2 {
    public static void main(String[] args) throws Exception{
        //使用BufferedWriter,向"f:/output" 输出一句话"hello world",并能过BufferedReader,流读出这段文字

        BufferedWriter bw = new BufferedWriter(new FileWriter("D://output"));
        BufferedReader br = new BufferedReader(new FileReader("D://output"));
        bw.write("hello world");
        bw.flush();

        System.out.println(br.readLine());
        String str = "";
        while ((str = br.readLine()) != null){
            System.out.println(str);
        }
        br.close();
        bw.close();

    }
}
